package createModel.BuilderModel.directorBuilderPlayers02;

import createModel.BuilderModel.directorBuilderPlayers02.convert.Convert;

/**
 * 功能描述:指挥者, 负责协调建造者Abuilder, 创建产品Product, 转换convert
 * 2024/06/10
 *
 * @author ZhangYi
 */
public class Director {
    private AbstaractBasicConfigBuilder builder;

    public void setBuilder(AbstaractBasicConfigBuilder builder) {
        this.builder = builder;
    }

    public <T> BasicConfig createBasicConfig(Convert<T> convert, T source) throws Exception {
        convert.apply(builder,source);
        return builder.createBasicConfig();
    }

}
